package org.mobai.flow.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * bpmn节点类型枚举
 *
 * @author hyk
 */

@Getter
@AllArgsConstructor
public enum BpmnEnum {
    USER_TASK("approval", "userTaskBpmnImpl"),
    START_EVENT("start", "startEventBpmnImpl"),
    END_EVENT("end", "endEventBpmnImpl"),
    EXCLUSIVE_GATEWAY("exclusive", "exclusiveGatewayBpmnImpl");
    private final String value;
    private final String bpmnStrategy;

    public static String getBpmnStrategy(String value) {
        for (BpmnEnum bpmnEnum : BpmnEnum.values()) {
            if (bpmnEnum.value.equals(value)) {
                return bpmnEnum.bpmnStrategy;
            }
        }
        throw new RuntimeException("未找到对应组件");
    }

}
